package cn.izeno.wx.models.component

import com.alibaba.fastjson.annotation.JSONField

/**
 * 公众号/小程序 预授权码
 */
class AppPreAuthCode {
  @field:JSONField(name = "errcode")
  var errCode: Int = 0

  @field:JSONField(name = "errmsg")
  var errMsg = ""

  @field:JSONField(name = "pre_auth_code")
  var preAuthCode: String = ""

  // 10 min
  @field:JSONField(name = "expires_in")
  var expiredAt: Long = 600
    set(value) {
      field = System.currentTimeMillis() + value * 1000
    }
}
